home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Chat & Communication / Digsby build 37 / digsby_setup.exe / lib / util / threads / bgthread.pyo (.txt) < prev    next >
Python Compiled Bytecode  |  2008-10-13  |  2KB  |  35 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. from util.primitives import Delegate
  5. import threading
  6.  
  7. class DelegateThread(threading.Thread):
  8.     
  9.     def __init__(self, group = None, target = None, name = None, args = (), kwargs = None, verbose = None):
  10.         threading.Thread.__init__(self, group, target, name, args, kwargs, verbose)
  11.         self.BeforeRun = Delegate()
  12.         self.AfterRun = Delegate()
  13.  
  14.  
  15.  
  16. class BackgroundThread(DelegateThread):
  17.     
  18.     def __init__(self, group = None, target = None, name = None, args = (), kwargs = None, verbose = None):
  19.         DelegateThread.__init__(self, group, target, name, args, kwargs, verbose)
  20.         self.setDaemon(True)
  21.         self.BeforeRun[:] = _before_run
  22.         self.AfterRun[:] = _after_run
  23.  
  24.  
  25. _before_run = []
  26. _after_run = []
  27.  
  28. def add_before_cb(cb):
  29.     _before_run.append(cb)
  30.  
  31.  
  32. def add_after_cb(cb):
  33.     _after_run.append(cb)
  34.  
  35.